<?php get_header(); ?>
<script>
  var ss = '';
  $(document).ready(function(){
    ss = $('.slideshow').bxSlider({
      pager: true,
      controls: false,
			auto: true,
      mode: 'fade',
      speed: 500
    });
  });
  
  $(window).resize(function(){
    // var w = $(window).width();
    // $('.slideshow li img').css('width', w+'px');
    // $('.slideshow li').css('width', w+'px');
    // $('.slideshow .bx-wrapper').css('width', w+'px');
    // $('.slideshow .bx-window').css('width', w+'px');
    // ss.reloadShow();
  });
</script>

<style>
  .slideshow, .bx-wrapper, .bx-window{ height: 100%; }
  .slideshow li{
    margin: 0;
    padding: 0;
    background-position: top center;
    background-repeat: no-repeat;
    background-color: #fff;
    /* This next one is for IE6 */
    background-attachment: fixed;
    height: 100%;
    width: 100%;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
  }
</style>

<ul class="slideshow">
<?php
  $args = array(
    'numberposts' => -1,
    'category' => 15
  );
  
  $posts = get_posts($args);
  
  foreach($posts as $post){
    // $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    $attachments = attachments_get_attachments();
    foreach($attachments as $attachment){
?>
  <li style="background-image: url('<?php echo $attachment['location'] ?>');"></li>
<?php }} ?>
</ul>

<?php get_footer(); ?>
